//
//  LoginModel.m
//  GLGW_Shoping
//
//  Created by yang on 2018/12/13.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "LoginModel.h"

@implementation LoginModel
//自定义对象转换NSData
- (void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeObject:self.message forKey:@"message"];
    [aCoder encodeInteger:self.code forKey:@"code"];
    [aCoder encodeObject:self.data forKey:@"data"];
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder{
    if (self = [super init]) {
        self.message = [aDecoder decodeObjectForKey:@"message"];
        self.data = [aDecoder decodeObjectForKey:@"data"];
        self.code = [aDecoder decodeIntegerForKey:@"code"];
    }
    return self;
}
@end

@implementation LoginModel_Data
//自定义对象转换NSData
- (void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeObject:self.avatar forKey:@"avatar"];
    [aCoder encodeObject:self.nickName forKey:@"nickName"];
    [aCoder encodeObject:self.token forKey:@"token"];
    [aCoder encodeObject:self.regeditTypes forKey:@"regeditTypes"];
    [aCoder encodeInteger:self.type forKey:@"type"];
    [aCoder encodeObject:self.userId forKey:@"userId"];
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder{
    if (self = [super init]) {
        self.avatar = [aDecoder decodeObjectForKey:@"avatar"];
        self.nickName = [aDecoder decodeObjectForKey:@"nickName"];
        self.token = [aDecoder decodeObjectForKey:@"token"];
        self.regeditTypes = [aDecoder decodeObjectForKey:@"regeditTypes"];
        self.type = [aDecoder decodeIntegerForKey:@"type"];
        self.userId = [aDecoder decodeObjectForKey:@"userId"];
    }
    return self;
}
@end

@implementation LoginModel_RegeditTypes
//自定义对象转换NSData
- (void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeInteger:self.isQQregist forKey:@"isQQregist"];
    [aCoder encodeInteger:self.isWxRegist forKey:@"isWxRegist"];
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder{
    if (self = [super init]) {
        self.isQQregist = [aDecoder decodeIntegerForKey:@"isQQregist"];
        self.isWxRegist = [aDecoder decodeIntegerForKey:@"isWxRegist"];
    }
    return self;
}
@end
